<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>MeteoCal - #{eventView.event.title}</title>
    </h:head>
    <h:body>
        <style>


            .centered{
                vertical-align: middle;
            }

            .fiftyPercent{
                width: 50%;
                text-align: center;
                margin:0px auto;
            }
            .rightAll{
                width: 50%;
                text-align: right;
            }
            .leftAll{
                width: 50%;
                text-align: left;
            }
            .oneThirdPercent{
                width: 33%;
            }
            .twoThirdPercent{
                width: 67%;
            }


        </style>
        <ui:composition template="mainlayout.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:panel>
                        <f:facet name="header">
                            <h:panelGroup style="display: block; text-align:center">
                                <h:outputText value="#{eventView.event.title}"/>
                            </h:panelGroup>
                        </f:facet>
                        <p:panel>
                            <h:panelGrid style=" width: 100%" columns="2" columnClasses="oneThirdPercent,twoThirdPercent">

                                <h:panelGrid style=" width: 100%" columns="1">
                                    <h:outputText value="Title: #{eventView.event.title}" />
                                    <h:outputText value="Start: #{eventView.event.startDate}" >
                                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1"/>
                                    </h:outputText>
                                    <h:outputText value="End: #{eventView.event.endDate}" >
                                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1"/>
                                    </h:outputText>
                                    <h:outputText value="Place: #{eventView.event.place}" />
                                    <h:outputText value="Description: #{eventView.event.description}" />
                                    <h:outputText value="Created by: #{eventView.event.createdBy.name}" />

                                </h:panelGrid>
                                <h:panelGrid style=" width: 100%" columns="2">
                                    <p:dataList value="#{eventView.invitated}" var="inv" style="width:98%">
                                        <f:facet name="header">
                                            Invited
                                        </f:facet>
                                        #{inv.username} - #{inv.name},#{inv.surname}
                                    </p:dataList>
                                    <p:dataList value="#{eventView.event.goingUsers}" var="cal" style="width:98%">
                                        <f:facet name="header">
                                            Going
                                        </f:facet>
                                        #{cal.user.username} - #{cal.user.name},#{cal.user.surname}
                                    </p:dataList>
                                </h:panelGrid>
                            </h:panelGrid>
                        </p:panel>

                        <p:separator />
                        <h:panelGroup style="display:block; text-align:center">
                            <p:commandButton value="Edit Event" action="#{eventView.startWizard}" rendered="#{eventView.creator}"/>
                            <p:commandButton value="Remove Event" action="#{eventView.remove}" rendered="#{eventView.mineOrCreator}"/>
                        </h:panelGroup>

                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>

    </h:body>
</html>

